// Require.js allows us to configure shortcut alias
require.config({

  // The shim config allows us to configure dependencies for 
  // scripts that do not call define() to register a module
	shim: {
	    'underscore': {
	        exports: '_'
	    },
        'jquery':{
            exports : 'jQuery'
        },
        'bgstretcher' : {
            deps:['jquery'],
            exports : 'jQuery.fn.bgStretcher'
        },
        'fullCalendar' : {
            deps:['jquery','jqueryUI'],
//            exports : 'jQuery.ui'
            exports : 'jQuery.fn.fullCalendar'
        },

        'jqueryUI' : {
            deps:['jquery'],
//            exports : 'jQuery.ui'
            exports : 'jQuery.ui'
        },
	    'backbone': {
	        deps: ['underscore', 'jquery'],
	        exports: 'Backbone'
	    }

	},

	paths: {
		jquery: 'libs/jquery/jquery-1.8.1.min',
		jqueryUI: 'libs/jquery/jquery-ui-1.9.0.custom.min',
		underscore: 'libs/underscore/underscore',
		backbone: 'libs/backbone/backbone',
		text: 'libs/require/text',
        iscroll: 'libs/iScroll/iscroll',
        backboneRelational: 'libs/backbone/backbone-relational',
        bgstretcher:'libs/bgstretcher',
        fullCalendar:'libs/fullcalendar/fullcalendar.min'
	}

});

require(['jquery','routers/router','bgstretcher'], function($, Workspace){

  // Initialize routing and start Backbone.history()


  // Initialize the application view

  //TODO: Bring this code to the view that render the business images.
  $(document).ready(function(){

        //  Initialize Backgound Stretcher
        $('#business-header').bgStretcher({
            images: [''],
            imageWidth: 1024,
            imageHeight: 768,
            slideDirection: 'N',
            slideShowSpeed: 1000,
            transitionEffect: 'fade',
            sequenceMode: 'normal',
            anchoring: 'left center',
            anchoringImg: 'left center'
        });

    });

    app = new Workspace;
    app.showLeftNav();
    Backbone.history.start();


});
